package javase0906;
class User {
    private String username;
    private String password;
    // 其他用户信息字段
    public User(String name,String password){
        this.username=name;
        this.password=password;
}
    // 构造函数、getter和setter方法
    public String getUsername() {
        return username;
    }

    public void setUsername(String username){
        this.username = username;
    }
    public String getPassword(){
        return password;
    }

    public void setPassword(String password){
        this.password = password;
    }
    //用户登录验证
    public boolean authenticate(String username,String password){
        return this.username.equals(username)&& this.password.equals(password);
    }
}
